﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ThreeDPrinting.ORM;
using System.Web.Mail;
using SMTP.Utilities;
using ThreeDPrinting.Utilities;
using ThreeDPrinting.Entities;

namespace ThreeDPrinting.Pages.Sell
{
    public partial class UPSShipping : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        protected void btnSubmit_Click(object sender, EventArgs e)
        {
            ShippingForm sf = new ShippingForm();
            sf.Name = txtname.Text;
            sf.AddressLine = txtAddress.Text;
            sf.City = txtCity.Text;
            sf.StateProvinceCode = txtState.Text;
            sf.PostalCode = txtZipCode.Text;
            sf.CountryCode = txtCountryCode.Text;
            string returnvalue = ShipClient.Main(sf);
            lblTrackNum.Text = returnvalue;
            string itemName = "has bought " + txtItemName.Text + ".";
            string name = txtname.Text;
            string email = txtEmail.Text;
            string trackNum = returnvalue;
            MailHelper.SendMailMessage("account@digireal.com", email, null, null, "Digi-Real Tracking Information", name + " " + itemName + "" + trackNum +".");
            lblTrackNum.Text = returnvalue;

        }

        protected void btnShopping_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Default.aspx");
        }
    }
}